import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { lotcarchargeVO, lotcarchargeForm, lotcarchargeQuery } from '@/api/parkinglot/lotCarCharge/types';

/**
 * 查询收费记录列表
 * @param query
 * @returns {*}
 */

export const listlotcarcharge = (query?: lotcarchargeQuery): AxiosPromise<lotcarchargeVO[]> => {
  return request({
    url: '/parkinglot/lotCarCharge/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询收费记录详细
 * @param parkingLotCarChargeId
 */
export const getlotcarcharge = (parkingLotCarChargeId: string | number): AxiosPromise<lotcarchargeVO> => {
  return request({
    url: '/parkinglot/lotCarCharge/' + parkingLotCarChargeId,
    method: 'get'
  });
};

/**
 * 新增收费记录
 * @param data
 */
export const addlotcarcharge = (data: lotcarchargeForm) => {
  return request({
    url: '/parkinglot/lotCarCharge',
    method: 'post',
    data: data
  });
};

/**
 * 修改收费记录
 * @param data
 */
export const updatelotcarcharge = (data: lotcarchargeForm) => {
  return request({
    url: '/parkinglot/lotCarCharge',
    method: 'put',
    data: data
  });
};

/**
 * 删除收费记录
 * @param parkingLotCarOutId
 */
export const dellotcarcharge = (parkingLotCarOutId: string | number | Array<string | number>) => {
  return request({
    url: '/parkinglot/lotCarCharge/' + parkingLotCarOutId,
    method: 'delete'
  });
};
